import { mapGetters } from 'vuex'
export default {
  computed: {
    ...mapGetters('cart', ['count'])
  },
  methods: {
    getBadge() {
      uni.setTabBarBadge({
        index: 2,
        text: `${this.count}`
      });
    }
  },
  onShow() {
    this.getBadge()
  },
  watch: {
    count() {
      this.getBadge()
    }
  }
}
